79 research outputs found

    Object-oriented model for partially separable functions in parameter estimation

    Get PDF
    In parameter estimation, a model function depending on adjustable parameter

    C++ lambda expressions and closures

    Get PDF
    AbstractA style of programming that uses higher-order functions has become common in C++, following the introduction of the Standard Template Library (STL) into the standard library. In addition to their utility as arguments to STL algorithms, function parameters are useful as callbacks on GUI events, defining tasks to be executed in a thread, and so forth. C++’s mechanisms for defining functions or function objects are, however, rather verbose, and they often force the function’s definition to be placed far from its use. As a result, C++ frustrates programmers in taking full advantage of its own standard libraries. The effective use of modern C++ libraries calls for a concise mechanism for defining small one-off functions in the language, a need that can be fulfilled with lambda expressions.This paper describes a design and implementation of language support for lambda expressions in C++. C++’s compilation model, where activation records are maintained in a stack, and the lack of automatic object lifetime management make safe lambda functions and closures challenging: if a closure outlives its scope of definition, references stored in a closure dangle. Our design is careful to balance between conciseness of syntax and explicit annotations to guarantee safety. The presented design is included in the draft specification of the forthcoming major revision of the ISO C++ standard, dubbed C++0x. In rewriting typical C++ programs to take advantage of lambda functions, we observed clear benefits, such as reduced code size and improved clarity

    Reusable Multi-selection in Touch-Screen User Interfaces

    Get PDF
    Multi-selection is the act of selecting a set of elements in a graphical user interface in order to perform an operation on that set. Examples of multi-selection are selecting thumbnails in an image gallery or files on a file explorer. Whether and how multi-selection is supported in different applications varies widely, which leaves user experiences wanting. Järvi and Parent recently introduced an abstract model of multi-selection that helps programmers to implement multi-selection uniformly and correctly in desktop GUIs. This paper adapts the model to touch-screen devices. We present the rationale for choosing particular gestures for selection commands and explain how they map to the original model. A user study comparing our selection model with the established multi-selection features used by major Android and iOS applications shows that our selection feature allows for the fastest and most accurate selection

    Community Evolution in Bitcoin Investor Networks

    Get PDF
    The rise of cryptocurrencies is one of the phenomena characterizing the past decade. What sets cryptocurrencies apart from the traditional ones is that no central party is required for enforcing the transaction rules and the transactions are also publicly available. Meanwhile, network analysis tools have become widely popular for explaining the complex world shaped by social interaction. Even though the Complex Networks approach has been used for inspecting Bitcoin, the most widely adapted cryptocurrency, no prior study investigates the dynamics of investor communities in Bitcoin networks. The existing studies mostly focus on directed Bitcoin transfer networks while behavioural synchronization networks have not been sufficiently addressed. This thesis sheds a light on the social aspect of Bitcoin by exploring the dynamics of clusters of investors who time their trades similarly. To conduct such a research, we retrieve the public ledger of Bitcoin transactions and extract over 170 million Bitcoin wallets from the anonymous data. A network of active wallets is formed for each month from 2009 until the end of 2019, and two wallets are connected if their trade timing passes a statistical similarity test. Network analysis tools are used for detecting communities in the formed networks, and community evolution analysis is performed by analyzing the community structure of subsequent monthly networks. Our results show that Bitcoin investor communities are mostly short-lived but some persist for months or even years. We also find out that the long-lived investor communities prefer splitting over merging when it comes to persistence methods. This research not only produces novel information, which is valuable as such, but also lays a solid basis for future studies concerned with the evolution of Bitcoin communities by bringing together best practices of varying disciplines

    VisAST: Generic AST Visualiser for Software Language Education

    Get PDF
    Structural concepts such as abstract syntax trees (ASTs) are often best explained through visual representations. Students may, however, struggle with connecting such visual representations with the corresponding program text. To bridge this gap, we developed visAST, a tool for easily visualising ASTs of small languages written in Haskell. To assess the benefits and usability of visAST we conducted a user study in the context of students implementing interpreters. Students reported liking visAST and it being beneficial for learning. The experiment’s results were not conclusive, but hint at visAST use improving students’ performance.publishedVersio

    Finite difference methods fengshui: alignment through a mathematics of arrays

    Get PDF
    Numerous scientific-computational domains make use of array data. The core computing of the numerical methods and the algorithms involved is related to multi-dimensional array manipulation. Memory layout and the access patterns of that data are crucial to the optimal performance of the array-based computations. As we move towards exascale computing, writing portable code for efficient data parallel computations is increasingly requiring an abstract productive working environment. To that end, we present the design of a framework for optimizing scientific array-based computations, building a case study for a Partial Differential Equations solver. By embedding the Mathematics of Arrays formalism in the Magnolia programming language, we assemble a software stack capable of abstracting the continuous high-level application layer from the discrete formulation of the collective array-based numerical methods and algorithms and the final detailed low-level code. The case study lays the groundwork for achieving optimized memory layout and efficient computations while preserving a stable abstraction layer independent of underlying algorithms and changes in the architecture.Peer ReviewedPostprint (author's final draft

    Programming with C++ concepts

    Get PDF
    AbstractThis paper explores the definition, applications, and limitations of concepts and concept maps in C++, with a focus on library composition. We also compare and contrast concepts to adaptation mechanisms in other languages.Efficient, non-intrusive adaptation mechanisms are essential when adapting data structures to a library’s API. Development with reusable components is a widely practiced method of building software. Components vary in form, ranging from source code to non-modifiable binary libraries. The Concepts language features, slated to appear in the next version of C++, have been designed with such compositions in mind, promising an improved ability to create generic, non-intrusive, efficient, and identity-preserving adapters.We report on two cases of data structure adaptation between different libraries, and illustrate best practices and idioms. First, we adapt GUI widgets from several libraries, with differing APIs, for use with a generic layout engine. We further develop this example to describe the run-time concept idiom, extending the applicability of concepts to domains where run-time polymorphism is required. Second, we compose an image processing library and a graph algorithm library, by making use of a transparent adaptation layer, enabling the efficient application of graph algorithms to the image processing domain. We use the adaptation layer to realize a few key algorithms, and report little or no performance degradation

    Revisiting Language Support for Generic Programming: When Genericity Is a Core Design Goal

    Get PDF
    Context Generic programming, as defined by Stepanov, is a methodology for writing efficient and reusable algorithms by considering only the required properties of their underlying data types and operations. Generic programming has proven to be an effective means of constructing libraries of reusable software components in languages that support it. Generics-related language design choices play a major role in how conducive generic programming is in practice. Inquiry Several mainstream programming languages (e.g. Java and C++) were first created without generics; features to support generic programming were added later, gradually. Much of the existing literature on supporting generic programming focuses thus on retrofitting generic programming into existing languages and identifying related implementation challenges. Is the programming experience significantly better, or different when programming with a language designed for generic programming without limitations from prior language design choices? Approach We examine Magnolia, a language designed to embody generic programming. Magnolia is representative of an approach to language design rooted in algebraic specifications. We repeat a well-known experiment, where we put Magnolia’s generic programming facilities under scrutiny by implementing a subset of the Boost Graph Library, and reflect on our development experience. Knowledge We discover that the idioms identified as key features for supporting Stepanov-style generic programming in the previous studies and work on the topic do not tell a full story. We clarify which of them are more of a means to an end, rather than fundamental features for supporting generic programming. Based on the development experience with Magnolia, we identify variadics as an additional key feature for generic programming and point out limitations and challenges of genericity by property. Grounding Our work uses a well-known framework for evaluating the generic programming facilities of a language from the literature to evaluate the algebraic approach through Magnolia, and we draw comparisons with well-known programming languages. Importance This work gives a fresh perspective on generic programming, and clarifies what are fundamental language properties and their trade-offs when considering supporting Stepanov-style generic programming. The understanding of how to set the ground for generic programming will inform future language design.publishedVersio

    Revisiting Language Support for Generic Programming: When Genericity Is a Core Design Goal

    Get PDF
    ContextGeneric programming, as defined by Stepanov, is a methodology for writing efficient and reusable algorithms by considering only the required properties of their underlying data types and operations. Generic programming has proven to be an effective means of constructing libraries of reusable software components in languages that support it. Generics-related language design choices play a major role in how conducive generic programming is in practice.InquirySeveral mainstream programming languages (e.g. Java and C++) were first created without generics; features to support generic programming were added later, gradually. Much of the existing literature on supporting generic programming focuses thus on retrofitting generic programming into existing languages and identifying related implementation challenges. Is the programming experience significantly better, or different when programming with a language designed for generic programming without limitations from prior language design choices?ApproachWe examine Magnolia, a language designed to embody generic programming. Magnolia is representative of an approach to language design rooted in algebraic specifications. We repeat a well-known experiment, where we put Magnolia’s generic programming facilities under scrutiny by implementing a subset of the Boost Graph Library, and reflect on our development experience.KnowledgeWe discover that the idioms identified as key features for supporting Stepanov-style generic programming in the previous studies and work on the topic do not tell a full story. We clarify which of them are more of a means to an end, rather than fundamental features for supporting generic programming. Based on the development experience with Magnolia, we identify variadics as an additional key feature for generic programming and point out limitations and challenges of genericity by property.GroundingOur work uses a well-known framework for evaluating the generic programming facilities of a language from the literature to evaluate the algebraic approach through Magnolia, and we draw comparisons with well-known programming languages.ImportanceThis work gives a fresh perspective on generic programming, and clarifies what are fundamental language properties and their trade-offs when considering supporting Stepanov-style generic programming. The understanding of how to set the ground for generic programming will inform future language design.</p
    corecore